package com.joinway.framework.workflow.common.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.joinway.framework.data.jdbc.repository.MultiDataSourceTableRepository;
import com.joinway.framework.workflow.common.bean.domain.Region;

@Repository
public class WorkflowDao {

	@Autowired MultiDataSourceTableRepository repository;
	
	public List<Region> findAllRegion() throws Exception {
		repository.useReadOnlyDataSource(0);
		
		return repository.find(Region.class, "select * from region where type = 1 or type = 2 order by id");
	}
}
